package com.gitee.wsl.io.dataproxy

open class DoubleArrayProxy(val list:DoubleArray): DataProxy<Double> {

    override fun iterator() = list.iterator()

    override val size: Int get() = list.size

        override fun get(index: Int): Double = list[index]

        override fun set(index: Int, value: Double) {
            list[index] = value
        }

    override fun fill(value: Double, fromIndex: Int, toIndex: Int) {
        list.fill(value,fromIndex, toIndex)
    }

    override fun values(): List<Double> = list.toList()


}

fun DoubleArray.asProxy() = DoubleArrayProxy(this)